<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Đặng Khánh Trung
 * Date: 11/2/12
 * Time: 11:33 AM
 * To change this template use File | Settings | File Templates.
 */
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.multiselect');
JHtml::_('behavior.mootools');

JHtml::_('behavior.keepalive');

$canbo = $this->get('canbo');
$phongs = $this->get('phong');
if (count($phongs) > 1) 
    $phong = $phongs[0];
elseif (count($phongs) == 1)
    $phong = $phongs;
$donvis = $this->get('donvi');
if (count($donvis) > 1)
    $donvi = $donvis[0];
elseif (count($donvis) == 1)
    $donvi = $donvis;
$khoi = $this->get('khoi');
$hosocanbo = VastHelper::getHosocanbo();
if (!JFactory::getUser()->authorise('vast.hosocanbo.edit', 'com_vast') && !(JFactory::getUser()->authorise('vast.hosocanbo.edit.own') && $hosocanbo != NULL && $hosocanbo->nguoidung_id == JFactory::getUser()->id))
{
    JFactory::getApplication()->redirect(JRoute::_('index.php?option=com_vast&view=vast'));                        
}
?>

<div id="crumbs">
    <div style="color: #222222;font-weight: normal;margin: 0;padding: 0">
        <a href="<?php echo JRoute::_('index.php?option=com_vast&view=vast') ?>">Trang chủ</a> »
        <span>Cơ cấu tổ chức</span> »
        <?php if (isset($khoi)): ?>        
        <a href="<?php echo JRoute::_('index.php?option=com_vast&view=donvitructhuoc&id=' . $khoi->id); ?>"><?php echo $khoi->ten ?></a> »                
        <?php endif; ?>
        <?php if (isset($donvi)): ?>
        <a href="<?php echo JRoute::_('index.php?option=com_vast&view=phongtructhuocs&id=' . $donvi->id); ?>"><?php echo $donvi->ten ?></a> »
        <?php endif; ?>
        <?php if (isset($phong)): ?>
        <span><?php echo $phong->ten; ?></span>        
        <?php endif; ?>
        <span><?php echo $canbo->hoten; ?></span>
    </div>
</div>

<div id="main" class="home">

<h3 class="title green">Thêm diễn biến học hàm cho cán bộ <?php echo $canbo->hoten ?></h3>

<div class="form">
    <form class="commentform form-validate" action="<?php echo JRoute::_('index.php?option=com_vast&view=themdienbienhocham&id=' . $canbo->id); ?>" method="post" id="themdienbienhocham" name="adminForm">

        <div class="row"><?php echo $this->form->getLabel('id'); ?>
            <?php echo $this->form->getInput('id'); ?>
        </div>

        <div class="row">
            <?php echo $this->form->getLabel('hosocanbo_id'); ?>
            <?php echo $this->form->getInput('hosocanbo_id'); ?>
        </div>

        <div class="row">
            <?php echo $this->form->getLabel('hocham_id'); ?>
            <?php echo $this->form->getInput('hocham_id'); ?>
        </div>

        <div class="row">
            <?php echo $this->form->getLabel('chuyennganh'); ?>
            <?php echo $this->form->getInput('chuyennganh'); ?>
        </div>

        <div class="row">
            <?php echo $this->form->getLabel('namphong'); ?>
            <?php echo $this->form->getInput('namphong'); ?>
        </div>
        
        <div class="row">
            <?php echo $this->form->getLabel('thangphong'); ?>
            <?php echo $this->form->getInput('thangphong'); ?>
        </div>

        <div class="row">
            <input type="hidden" name="option" value="com_vast" />
            <input type="hidden" name="task" value="themdienbienhocham.submit" />
        </div>
        <div class="row buttons">
            <button id="submit" type="submit" class="button validate"><?php echo JText::_('Thêm học hàm'); ?></button>
            <?php echo JHtml::_('form.token'); ?>
        </div>
    </form>
</div>
<div class="clr"></div>
</div>